//使用多个回调函数处理路由（指定 next 对象）
var express = require('express');
var myApp = express();
/*
myApp.get('/', function(req, res, next) {
    console.log('response will be sent by the next function ...');
    next();
}, function(req, res) {
    res.send('Hello');
});
myApp.listen(3000);*/

//使用回调函数数组处理路由：
var cb0 = function(req, res, next) {
    console.log('CB0');
    next();
}

var cb1 = function(req, res, next) {
    console.log('CB1');
    next();
}

var cb2 = function(req, res) {
    res.send('Hello from C!');
}

myApp.get('/', [cb0, cb1, cb2]);
myApp.listen(3000);